(defun c:mydimstyles ()
  (setq curdimsty (getvar "dimstyle"))
  (setq dimsty_lst NIL)
  (setq adimsty (tblnext "dimstyle" T))
  (if (not (wcmatch (cdr (assoc 2 adimsty)) "*|*"))
    (setq dimsty_lst (list (cdr (assoc 2 adimsty))))
  )
  (while (setq adimsty (tblnext "dimstyle"))
    (if (not (wcmatch (cdr (assoc 2 adimsty)) "*|*"))
      (setq dimsty_lst (append dimsty_lst (list (cdr (assoc 2 adimsty)))))
    )
  )
  (if (member "ARCHDIMS" dimsty_lst)
    nil
    (progn
      (load "archdims" "\nFile ARCHDIMS.LSP not loaded! ")
      (C:ARCHDIMS)
    )
  )
  (if (member "ARCHLEADERS" dimsty_lst)
    nil
    (progn
      (load "archldrs" "\nFile ARCHLDRS.LSP not loaded! ")
      (C:ARCHLDRS)
    )
  )
  (if (member "ENGRDIMS" dimsty_lst)
    nil
    (progn
      (load "engrdims" "\nFile ENGRDIMS.LSP not loaded! ")
      (C:ENGRDIMS)
    )
  )
  (if (member "ENGRLEADERS" dimsty_lst)
    nil
    (progn
      (load "engrldrs" "\nFile ENGRLDRS.LSP not loaded! ")
      (C:ENGRLDRS)
    )
  )
  (if (member "ELECLEADERS" dimsty_lst)
    nil
    (progn
      (load "elecldrs" "\nFile ELECLDRS.LSP not loaded! ")
      (C:ELECLDRS)
    )
  )
  (COND
    ((WCMATCH curdimsty "ARCHDIMS")
      (load "archdims" "\nFile ARCHDIMS.LSP not loaded! ")
      (C:ARCHDIMS)
    )
    ((WCMATCH curdimsty "ARCHLEADERS")
      (load "archldrs" "\nFile ARCHLDRS.LSP not loaded! ")
      (C:ARCHLDRS)
    )
    ((WCMATCH curdimsty "ENGRDIMS")
      (load "engrdims" "\nFile ENGRDIMS.LSP not loaded! ")
      (C:ENGRDIMS)
    )
    ((WCMATCH curdimsty "ENGRLEADERS")
      (load "engrldrs" "\nFile ENGRLDRS.LSP not loaded! ")
      (C:ENGRLDRS)
    )
    ((WCMATCH curdimsty "ELECLEADERS")
      (load "elecldrs" "\nFile ELECLDRS.LSP not loaded! ")
      (C:ELECLDRS)
    )
    ((EQ (GETVAR "lunits") 4)
      (load "archdims" "\nFile ARCHDIMS.LSP not loaded! ")
      (C:ARCHDIMS)
    )
    ((EQ (GETVAR "lunits") 2)
      (load "engrdims" "\nFile ENGRDIMS.LSP not loaded! ")
      (C:ENGRDIMS)
    )
    (T (COMMAND "-DIMSTYLE" "R" curdimsty))
  )
  (princ)
)
(DEFUN C:INLDRS ( / thedims)
  (C:MYDIMSTYLES)
  (SETQ thedims (SSGET '((-4 . "<OR")(0 . "DIMENSION")(0 . "LEADER")(-4 . "OR>"))))
  (IF thedims
    (PROGN
      (SETQ cnt 0)
      (WHILE (< cnt (SSLENGTH thedims))
        (SETQ thisdim (ENTGET (SSNAME thedims cnt)))
        (SETQ thisdim (SUBST (CONS 3 "ARCHLEADER")(ASSOC 3 thisdim)thisdim))
        (ENTMOD thisdim)
        (SETQ cnt (1+ cnt))
      )
    )
  )
)
(DEFUN C:FTLDRS ( / thedims)
  (C:MYDIMSTYLES)
  (SETQ thedims (SSGET '((-4 . "<OR")(0 . "DIMENSION")(0 . "LEADER")(-4 . "OR>"))))
  (IF thedims
    (PROGN
      (SETQ cnt 0)
      (WHILE (< cnt (SSLENGTH thedims))
        (SETQ thisdim (ENTGET (SSNAME thedims cnt)))
        (SETQ thisdim (SUBST (CONS 3 "ENGRLEADER")(ASSOC 3 thisdim)thisdim))
        (ENTMOD thisdim)
        (SETQ cnt (1+ cnt))
      )
    )
  )
)
(DEFUN C:ELLDRS ( / thedims)
  (C:MYDIMSTYLES)
  (SETQ thedims (SSGET '((-4 . "<OR")(0 . "DIMENSION")(0 . "LEADER")(-4 . "OR>"))))
  (IF thedims
    (PROGN
      (SETQ cnt 0)
      (WHILE (< cnt (SSLENGTH thedims))
        (SETQ thisdim (ENTGET (SSNAME thedims cnt)))
        (SETQ thisdim (SUBST (CONS 3 "ELECLEADER")(ASSOC 3 thisdim)thisdim))
        (ENTMOD thisdim)
        (SETQ cnt (1+ cnt))
      )
    )
  )
)
(DEFUN C:INDIMS ( / thedims)
  (C:MYDIMSTYLES)
  (SETQ thedims (SSGET '((-4 . "<OR")(0 . "DIMENSION")(0 . "LEADER")(-4 . "OR>"))))
  (IF thedims
    (PROGN
      (SETQ cnt 0)
      (WHILE (< cnt (SSLENGTH thedims))
        (SETQ thisdim (ENTGET (SSNAME thedims cnt)))
        (SETQ thisdim (SUBST (CONS 3 "ARCHDIMS")(ASSOC 3 thisdim)thisdim))
        (ENTMOD thisdim)
        (SETQ cnt (1+ cnt))
      )
    )
  )
)
(DEFUN C:FTDIMS ( / thedims)
  (C:MYDIMSTYLES)
  (SETQ thedims (SSGET '((-4 . "<OR")(0 . "DIMENSION")(0 . "LEADER")(-4 . "OR>"))))
  (IF thedims
    (PROGN
      (SETQ cnt 0)
      (WHILE (< cnt (SSLENGTH thedims))
        (SETQ thisdim (ENTGET (SSNAME thedims cnt)))
        (SETQ thisdim (SUBST (CONS 3 "ENGRDIMS")(ASSOC 3 thisdim)thisdim))
        (ENTMOD thisdim)
        (SETQ cnt (1+ cnt))
      )
    )
  )
)